package com.hx.xiao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hx.xiao.entity.Su;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface SuMapper  extends BaseMapper<Su> {

    @Select("SELECT COUNT(history) as his,history ll FROM su WHERE uid=#{id} GROUP BY history HAVING COUNT(history) ")
    List<Map> findById(Integer id);

    @Select(" SELECT biaoti,history FROM hou WHERE  (CASE WHEN #{hid} IS NOT NULL THEN komg = #{hid} ELSE 1 = 1 END)  ORDER BY history DESC LIMIT 10")
    List<Map> findtop10(Integer hid);
}
